import React, { Component } from 'react';
import Child from './child';
import {Button} from 'antd';
class Main extends Component {
    constructor(props){
        super(props);
        this.state = {
            count:0
        }
    }

    state = {
        count : 0
    }
    
    handleAdd = ()=>{
        this.setState({
            count : this.state.count + 1
        })
    }
    render(){
        let style = {
            padding : '10px',
            width : '100px'
        }
        return (
            
            <div>
                <p style={style}>{this.state.count}</p>
                <Button onClick={this.handleAdd}></Button>  
                <button onClick={this.handleAdd} >
                    点击一下
                </button>
                <Child count={this.state.count}/>
            </div>
        )
    }
}

export default Main
